package cn.tedu.exec;
/**本类用于面向对象的巩固练习*/
public class TestCar {
    public static void main(String[] args) {
        Car c = new Car();

       // c.brand = "本田";
      //  c.color = "白色";
       // c.length = 56;
       // c.price = 23;
      //  System.out.println(c.brand);
      //  System.out.println(c.color);
      //  System.out.println(c.length);
      //  System.out.println(c.price);

        c.start();
       // c.stop();

        Car c2 = new Car();
        c2.setBrand("大众");
        c2.setColor("黑色");
        c2.setLength(233);
        c2.setPrice(456);

        System.out.println(c2.getBrand());
        System.out.println(c2.getColor());
        System.out.println(c2.getLength());
        System.out.println(c2.getPrice());

    }
}
class Car{
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    private String brand;
   private String color;
   private double price;
   private double length;
    public void start(){
        System.out.println("我的小车车启动啦");
        stop();
    }
    private void stop(){
        System.out.println("熄火了");
    }
}
